package cn.edu.scau.cmi.linjinyong.singleton;

public class Chairman {
	private static Chairman chairman;
	private String name;
	
	private Chairman(String name) {
		this.name = name;
	}
	
	public static Chairman createChairman(String name) {
		
		if(chairman == null && name != null && !"".equals(name)) {
			chairman = new Chairman(name);
		}else {
			chairman.setName(name);
		}
		return chairman;
	}

	@Override
	public String toString() {
		String s = super.toString();
		return s.substring(s.indexOf("Chairman@"));
	}

	//getter & setter
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}
